﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Stock.Bl;

namespace Stock.WinForm
{
    public partial class GainGraph : Form
    {
        public GainGraph()
        {
            InitializeComponent();
        }

        private void GainGraph_Load(object sender, EventArgs e)
        {
            chartlet1.ChartTitle.Text = "Liu";
            chartlet1.AppearanceStyle = FanG.Chartlet.AppearanceStyles.Bar_2D_Aurora_FlatCrystal_Glow_NoBorder;
            chartlet1.Background.Paper = Color.FromArgb(0, 0, 0, 0);
            chartlet1.XLabels.UnitText = "元";
            chartlet1.YLabels.UnitText = "日期";

            chartlet1.Aurora[0] = Color.Black;
            chartlet1.Aurora[2] = Color.PaleVioletRed;
            chartlet1.Aurora[4] = Color.Plum;
            chartlet1.Aurora[3] = Color.LightSalmon;
            chartlet1.Aurora[1] = Color.Blue;
            chartlet1.Aurora[5] = Color.LightPink;

            GainGraphBll gainGraphBll = new GainGraphBll();
            chartlet1.BindChartData(gainGraphBll.getList(DateTime.Now.AddDays(-28), DateTime.Now));
        }

        private void GainGraph_FormClosed(object sender, FormClosedEventArgs e)
        {
            chartlet1.Dispose();
        }
    }
}